package Lab01;
import java.util.Scanner;
/**
 * Created by dell on 2017/10/15.
 */
public class Test12 {
    public static void main(String[] args) {
     Scanner s=new Scanner (System.in);
         System.out.println("请输入一个1-9999的数字：");
        int num=s.nextInt();
        if(num>0||num<9){
            System.out.println("这是个位数，是回文");
        }
        else if(num>9||num<=99){
            System.out.println("这是十位数");
            int aa = num /10 ;
            int i=num-(aa*10);
            num=i*10+aa;
            System.out.println("回文为"+num);
        }else if(num > 99 && num <= 999) {
            System.out.println("这是个百位数");
            int bb=num/100;
            int cc=num%100/10 ;
            int dd= num%10;
            num=dd*100+cc*10+bb;
            System.out.println(num);
        }else if(num > 999 && num <= 9999) {
            System.out.println("这是个千位数");
            int qq=num/1000;
            int ww=num%1000/100 ;
            int ee=num%100/10 ;
            int dd=num%10 ;
            num=dd*1000+ee*100+ww*10+qq;
            System.out.println(num);
        }
    }
}
